wx.config(jssdkconfig);
wx.error(function(res) {});
wx.ready(function() {
	wx.checkJsApi({
		jsApiList: ['onMenuShareAppMessage'], // 需要检测的JS接口列表，所有JS接口列表见附录2,
		success: function(res) {
			alert(res.checkResult.onMenuShareAppMessage);
		}
	});
	//wx.hideOptionMenu();
	$('#btnShare').on('click', function() {
		wx.showOptionMenu();
		wx.onMenuShareAppMessage({
			title: '分享百度', // 分享标题
			desc: '分享百度', // 分享描述
			link: 'https://www.baidu.com', // 分享链接
			imgUrl: "http://oss-cn-beijing.aliyuncs.com/luoyangpai/images/1/2015/10/h6aTrlR4il7UVD1d71N0T3r13n7uT5.png",
			//type: 'link', // 分享类型,music、video或link，不填默认为link
			//dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
			success: function() {
				// 用户确认分享后执行的回调函数
			},
			cancel: function() {
				// 用户取消分享后执行的回调函数
			}
		});
	});
	sharedata = {
		title: "博客园分享",
		desc: "博客园",
		link: 'http://cnblogs.com',
		imgUrl: "http://oss-cn-beijing.aliyuncs.com/luoyangpai/images/1/2015/10/h6aTrlR4il7UVD1d71N0T3r13n7uT5.png",
		success: function() {
			window.location.href = "http://mp.weixin.qq.com/s?__biz=MzA3OTI2NTQ1Mw==&mid=400166713&idx=1&sn=f30d32e64d09c12bd00a57fdb8c4dbd3#rd"
		},
		cancel: function() {}
	};
	wx.onMenuShareAppMessage(sharedata);
	wx.onMenuShareTimeline(sharedata);
	wx.showOptionMenu();
});